// 路由配置
import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/Home.vue'
// 安装路由插件
Vue.use(Router)
// 输出
export default new Router({
  // 路由：根据不同的path渲染对应的组件
  routes: [{
      path: '/',
      redirect: '/Upcoming', //默认路径重定向到主页
    },
    {
      path: '/home', //路径
      name: 'home', //名字
      component: Home, //组件
      children: [
        // {
        //   path: '',
        //   redirect: 'Upcoming'
        // },
        {
          path: '/Upcoming',  //首页
          name: 'Upcoming',
          component: () => import('./views/Upcoming.vue')
        },
        {
          path: '/Aa',  //
          name: 'Aa',
          component: () => import('./views/Aa.vue')
        },
        {
          path: '/Details/:id',  //电影详情
          name: 'Details',
          component: () => import('./views/Details.vue')
        },
        {
          path: '/Movies/:id',//动态路由    //电影
          name: 'Movies',
          component: () => import('./views/Movies.vue')
        },
        {
          path: '/MoviesDetails',   //电影人物详细信息
          name: 'MoviesDetails',
          component: () => import('./views/MoviesDetails.vue')
        },
        {
          path: '/Search',  //搜索页
          name: 'Search',
          component: () => import('./views/Search.vue')
        },
      ],

      //     },
      //     {
      //       path: '/about',
      //       name: 'about',
      //       // route level code-splitting
      //       // this generates a separate chunk (about.[hash].js) for this route
      //       // which is lazy-loaded when the route is visited.
      //       // 路由懒加载：将组件分离成单独的js文件，按需加载
      //       component: () => import(/* webpackChunkName: "about" */ './views/About.vue')
      //     },  //追加路由
      //     {
      //       path: '/qqzone',
      //       name: 'qqzone',
      //       // route level code-splitting
      //       // this generates a separate chunk (about.[hash].js) for this route
      //       // which is lazy-loaded when the route is visited.
      //       // 路由懒加载：将组件分离成单独的js文件，按需加载
      //       component: () => import(/* webpackChunkName: "about" */ './views/Qqzone.vue')
      //     },
      //     {
      //       // path:'/list',
      //       path:'/list/:id', //动态路由
      //       name:'list',
      //       component:()=>import('./views/List.vue'),
      //       children:[  //子路由
      //         { path:'html',// list/123/html
      //           name:'list_html',
      //           component:()=>import('./views/Html.vue')
      //         },
      //         { path:'css',// list/123/css
      //           name:'list_css',
      //           component:()=>import('./views/Css.vue')
      //         }
      //       ]
      //     },
      //     {
      //       path:'/detailed//moreComingList/movieId=:id', //动态路由
      //       name:'detailed',
      //       component:()=>import('./views/Detailed.vue'),



    },
    // {
    //   path: '/Upcoming', //路径
    //   name: 'Upcoming', //名字
    //   component: () => import('./views/Upcoming.vue')
    // },
    // {
    //   path: '/Aa', //路径
    //   name: 'Aa', //名字
    //   component: () => import('./views/Aa.vue')
    // },
  ]
})